package cn.xingzhe.monster.user.domain.enums;

import open.intellijboy.framework.core.response.BaseEnum;

/**
 * 用户状态枚举
 *
 * @author System
 * @version 1.0.0
 * @since 2024-01-01
 */
public enum UserStatusEnum implements BaseEnum {

    /**
     * 激活状态
     */
    ACTIVE(1, "激活"),

    /**
     * 未激活状态
     */
    INACTIVE(0, "未激活"),

    /**
     * 锁定状态
     */
    LOCKED(2, "锁定");

    private final Integer code;
    private final String message;

    UserStatusEnum(Integer code, String message) {
        this.code = code;
        this.message = message;
    }

    @Override
    public Integer getCode() {
        return code;
    }

    @Override
    public String getMessage() {
        return message;
    }

    /**
     * 根据code获取枚举
     *
     * @param code 枚举码
     * @return 枚举实例
     */
    public static UserStatusEnum getByCode(Integer code) {
        return BaseEnum.getByCode(UserStatusEnum.class, code);
    }
}

